package homework;

import java.util.Scanner;

public class One_Variable_Quadratic {
	 public static void main(String[] args) {
	        Scanner scanner = new Scanner(System.in);
	        // 获取输入的三个系数
	        double a = scanner.nextDouble();
	        double b = scanner.nextDouble();
	        double c = scanner.nextDouble();
	        // ---------------------Begin------------------------
	        // 计算判别式
	        double delta = b * b - 4 * a * c;

	        // 判断根的情况
	        if (delta > 0) {
	            // 两个不同的实根
	            double x1 = (-b + Math.sqrt(delta)) / (2 * a);
	            double x2 = (-b - Math.sqrt(delta)) / (2 * a);
	            System.out.printf("方程有两个解：x1=%.2f x2=%.2f\n", x1, x2);
	        } else if (delta == 0) {
	            // 一个实根
	            double x = (-b) / (2 * a);
	            System.out.printf("方程有一个解：x=%.2f\n", x);
	        } else {
	            // 无实根
	            System.out.println("此方程无解");
	        }
	        // ---------------------End------------------------
	    }

}
